package com.jason.library.common.utils;

import android.content.Context;
import android.widget.Toast;

/**
 * Description:ToastUtils
 *
 * @author 陈宝阳
 * @create 2020/11/17 14:59
 */
public class ToastUtils {

    private static Context applicationContext;

    private ToastUtils(){}

    public static void init(Context context) {
        applicationContext = context;
    }

    public static void showToast(String text) {
        showToast(applicationContext, text);
    }

    public static void showToast(Context context, String text) {
        Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
    }

    public static void showToast(int resId) {
        showToast(applicationContext, resId);
    }

    public static void showToast(Context context, int resId) {
        Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
    }

}
